/// 测试Result
pub fn test() {
    let x1 = 2;
    let x2 = 10;
    match larger_than_3(x1) {
        Ok(t) =>
            println!("{} is larger than 3: {}", x1, t),
        Err(e) =>
            println!("{} is larger than 3: {}", x1, e)
    }
    match larger_than_3(x2) {
        Ok(t) =>
            println!("{} is larger than 3: {}", x2, t),
        Err(e) =>
            println!("{} is larger than 3: {}", x2, e)
    }
}

fn larger_than_3(x: i32) -> Result<bool, String> {
    if x > 3 {
        Ok(true)
    } else {
        Err("not really".to_string())
    }
}